package com.esun.service.mq.enums;

import com.esun.dao.das.BaseDas;
import com.esun.dao.das.ExampleDas;
import com.esun.dao.eo.BaseEo;
import com.esun.dao.eo.ExampleEo;
import org.apache.commons.lang.StringUtils;

/**
 * @author John.xiao
 * @date 2021/9/2 11:35
 */
public enum DasEnum {
	EXAMPLE("example",new ExampleDas())
	;

	private String collection;

	private BaseDas das;

	DasEnum(String collection,BaseDas entity){
		this.collection = collection;
		this.das = entity;
	}

	public static DasEnum match(String collection){
		DasEnum[] dasEnums =  DasEnum.values();
		for (DasEnum value : dasEnums) {
			if (StringUtils.equals(value.getCollection(), collection)){
				return value;
			}
		}
		return null;
	}

	public String getCollection() {
		return collection;
	}

	public void setCollection(String collection) {
		this.collection = collection;
	}

	public BaseDas getDas() {
		return das;
	}

	public void setDas(BaseDas das) {
		this.das = das;
	}
}
